import request from '@/config/axios'

// 用户点赞 VO
export interface UserLikeVO {
  id: number // 编号
  articleId: number // 文章编号
  userId: number // 用户编号
  isLike: boolean // 是否点赞
  userName: string // 是否点赞
  articleName: string // 是否点赞
}

// 用户点赞 API
export const UserLikeApi = {
  // 查询用户点赞分页
  getUserLikePage: async (params: any) => {
    return await request.get({ url: `/blog/user-like/page`, params })
  },

  // 查询用户点赞详情
  getUserLike: async (id: number) => {
    return await request.get({ url: `/blog/user-like/get?id=` + id })
  },

  // 新增用户点赞
  createUserLike: async (data: UserLikeVO) => {
    return await request.post({ url: `/blog/user-like/create`, data })
  },

  // 修改用户点赞
  updateUserLike: async (data: UserLikeVO) => {
    return await request.put({ url: `/blog/user-like/update`, data })
  },

  // 删除用户点赞
  deleteUserLike: async (id: number) => {
    return await request.delete({ url: `/blog/user-like/delete?id=` + id })
  },

  // 导出用户点赞 Excel
  exportUserLike: async (params) => {
    return await request.download({ url: `/blog/user-like/export-excel`, params })
  },
}
